package com.jsbs.iam.user.feign;

import com.jsbs.iam.common.core.dto.Result;
import com.jsbs.iam.common.core.param.AccountInfoDto;
import com.jsbs.iam.user.dto.*;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @BelongsProject: iam
 * @BelongsPackage: com.jsbs.iam.user.feign
 * @Author: WangJiYuan
 * @Description:
 * @Version: 2022-12-30  10:40
 */
@FeignClient(value = "iam-ident",url = "${iam.ident.domain:127.0.0.1:82}")
public interface IdentFeignInterface {
    /**
     * 进行远程调用,获取账号数据
     *
     * @param identityAccountDto
     * @return
     */
    @PostMapping(value = "/iam/ident/identity/queryAccountList", consumes = "application/json")
    Result queryAccountList(IdentityAccountDto identityAccountDto);

    /**
     * 进行远程调用, 根据账户id查询账户数据
     * @param accountId
     * @return
     */
    @PostMapping(value = "/iam/ident/identity/getAccountBase", consumes = "application/json")
    Result getAccountBase(@RequestParam("accountId") String accountId,@RequestParam("companyCode") String companyCode);

    /**
     * 进行远程调用, 用户中心自动创建账户接口
     * @param accountInfoDtos
     * @return
     */
    @PostMapping(value ="/iam/ident/api/auto/account/create", consumes = "application/json")
    Result autoCreateAccount(List<AccountInfoDto> accountInfoDtos);

    /**
     * 删除账户数据
     *
     * @param deleteDto
     * @return
     */
    @PostMapping("/iam/ident/userApi/deleteAccount")
    public Result deleteAccount(@RequestBody UserInfoDeleteDto deleteDto);

    /**
     * 删除应用类型关联的策略
     *
     * @param deleteDto
     * @return
     */
    @PostMapping("/iam/ident/userApi/deleteStrategyRelation")
    public Result deleteStrategyRelation(@RequestBody ApplyTypeDeleteDto deleteDto);

    /**
     * 功能描述：根据用户编码将账户信息置为失效
     * @param failUserCodeList
     */
    @PostMapping(value = "/iam/ident/api/auto/account/fail", consumes = "application/json")
    Result autoFailUserAccount(@RequestBody List<String> failUserCodeList);

    /**
     * 根据用户数据查询账号数据
     *
     * @param applyConfigGetDto
     * @return
     */
    @PostMapping("/iam/ident/userApi/getAccountDataByUser")
    Result getAccountDataByUser(@RequestBody ApplyConfigGetDto applyConfigGetDto);

    /**
     * 根据用户id查看的应用详情
     *
     * @param iamApplyDetaislParam
     * @return Result
     */
    @PostMapping("/iam/ident/identity/getApplicationDetails")
    Result getApplicationDetails(@RequestBody IamApplyDetaislParam iamApplyDetaislParam);
}
